# coding:utf-8 
import pandas as pd
import numpy as np
import xlwings as xw
import time
from urllib import request 
from urllib import parse


class youpin(object):
	def __init__(self):
		'''初始设定'''
		self.secondid_dic = {
			"T恤": '686',
			"裤装": '687',
			"衬衫": '688',
			"运动/卫衣": '689',
			"外套": '690'
		}
		gc = 'goodsbycategory'
		self.init_url = r'https://youpin.mi.com'
		self.firstid = '93'
		self.url = r'https://youpin.mi.com/app/shopv3/pipe'
		self.lst_refer = [self.init_url, '/', gc, '?', 'firstId=', self.firstid, '&', 
			'secondId=', self.secondid_dic["T恤"], '&', 'title=', 'T恤']
		self.refer = parse.quote(''.join(self.lst_refer))
		self.headers = {
			'Host': 'youpin.mi.com',
			'Origin': self.init_url,
			'Referer': self.refer,
			'User-Agent': ('Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) '
						'Chrome/68.0.3440.84 Safari/537.36'),
			'Connection': 'keep-alive',
			'Accept': '*/*',
			'Accept-Encoding': 'gzip, deflate, br'
		}
		self.data = {
			'data': '{"uClassList":{"model":"Homepage","action":"BuildHome","parameters":{"id":"93"}}}'
		}
	def get_content(self):
		req = 
if __name__ == '__main__':
	Youpin = youpin()
	print(Youpin.headers)
